﻿using System.Text.Json.Serialization;

namespace wx.web.Models
{
    /// <summary>
    /// 
    /// </summary>
    public class WeChatApiResponse
    {
        [JsonPropertyName("errcode")]
        public int ErrorCode { get; set; }

        [JsonPropertyName("errmsg")]
        public string? ErrorMessage { get; set; }

        [JsonPropertyName("access_token")]
        public string? AccessToken { get; set; }

        [JsonPropertyName("expires_in")]
        public int ExpiresIn { get; set; }

        [JsonPropertyName("refresh_token")]
        public string? RefreshToken { get; set; }

        [JsonPropertyName("openid")]
        public string? OpenId { get; set; }

        [JsonPropertyName("scope")]
        public string? Scope { get; set; }
    }
    public class WeChatUserInfo : WeChatApiResponse
    {
        [JsonPropertyName("nickname")]
        public string? Nickname { get; set; }

        [JsonPropertyName("sex")]
        public int Sex { get; set; }

        [JsonPropertyName("province")]
        public string? Province { get; set; }

        [JsonPropertyName("city")]
        public string? City { get; set; }

        [JsonPropertyName("country")]
        public string? Country { get; set; }

        [JsonPropertyName("headimgurl")]
        public string? HeadImgUrl { get; set; }

        [JsonPropertyName("privilege")]
        public List<string> Privilege { get; set; } = new();

        [JsonPropertyName("unionid")]
        public string? UnionId { get; set; }
    }
}
